"use strict";
const ip = "127.0.0.1:8080";

const path = require("path");
const resolve = (dir) => path.join(__dirname, dir);
module.exports = {
  publicPath: "/",
  productionSourceMap: false,
  chainWebpack: (config) => {
    config.resolve.alias
      .set("@", resolve("src"))
      .set("~", resolve("public"))
      .set("assets", resolve("src/assets"));
    config.plugins.delete("prefetch");
  },
  devServer: {
    open: true,
    https: false,
    hotOnly: false,
    port: 8091,
    disableHostCheck: true,
    proxy: {
      // 配置跨域
      "/api": {
        target: ip,
        ws: false,
        changOrigin: true,
        pathRewrite: {
          "^/api": "",
        },
      },
    },
  },
};
